﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WcfServer.Classes.Utility;

namespace WcfServer.Classes.Server
{
    public class UserRequest
    {
        public string DstID { set; get; }

        public string SrcID { set; get; }

        public UserRequest(byte[] data, byte[] Key)
        {
            byte[] temp = Utility.EncryptionHandler.DecryptAES(data, Key);
            var ur = SerializerHandler<UserRequest>.DeSerializeInput(temp);
            this.DstID = ur.DstID;
            this.SrcID = ur.SrcID;
        }
        public byte[] Send(byte[] Key)
        {
            var ur = SerializerHandler<UserRequest>.SerializeInput(this);
            return EncryptionHandler.EncryptAES(ur, Key);
        }
    }
}
